const DictMixin = {
  data () {
    return {
      title: ''
    }
  },
  methods: {
    dictStepToSelect (value) {
      let selectValue = 0
      switch (value) {
        case this.$vo.RectStep.FIND:
          selectValue = this.$vo.RectStatus.INIT
          break
        case this.$vo.RectStep.PLAN:
          selectValue = this.$vo.RectStatus.TASK
          break
        case this.$vo.RectStep.APPR:
          selectValue = this.assessType === this.$vo.AssessType.CORP + '' ? this.$vo.RectStatus.PLAN : this.$vo.RectStatus.PRE_APPR
          break
        case this.$vo.RectStep.EXEC:
          selectValue = this.$vo.RectStatus.APPR
          break
        case this.$vo.RectStep.ACCE:
          selectValue = this.assessType === this.$vo.AssessType.CORP + '' ? this.$vo.RectStatus.EXEC : this.$vo.RectStatus.PRE_ACCE
          break
      }
      return selectValue
    },
    dictRectifyStat (value) {
      let stat = 0
      switch (value) {
        case this.$vo.RectStatus.INIT:
          stat = 0
          break
        case this.$vo.RectStatus.TASK:
          stat = 1
          break
        case this.$vo.RectStatus.PLAN:
          stat = 2
          break
        case this.$vo.RectStatus.PRE_APPR:
        case this.$vo.RectStatus.APPR:
          stat = 3
          break
        case this.$vo.RectStatus.EXEC:
          stat = 4
          break
        case this.$vo.RectStatus.PRE_ACCE:
        case this.$vo.RectStatus.ACCE:
          stat = 5
          break
      }
      return stat
    },
    dictRectifyStep (value) {
      let text = ''
      switch (value) {
        case this.$vo.RectStep.FIND:
          text = '整改问题发现'
          break
        case this.$vo.RectStep.PLAN:
          text = '整改措施制定'
          break
        case this.$vo.RectStep.APPR:
          text = '整改措施审核'
          break
        case this.$vo.RectStep.EXEC:
          text = '整改措施落实'
          break
        case this.$vo.RectStep.ACCE:
          text = '整改成果验收'
          break
      }
      return text
    },
    dictRctifyOperate (value) {
      let text = ''
      switch (value) {
        case this.$vo.RectStatus.TASK:
          text = '指定整改部门'
          break
        case this.$vo.RectStatus.PLAN:
          text = '提交整改措施'
          break
        case this.$vo.RectStatus.PRE_APPR:
          text = '专业部门审核整改措施'
          break
        case this.$vo.RectStatus.APPR:
          text = '安监部门审核整改措施'
          break
        case this.$vo.RectStatus.EXEC:
          text = '提交整改结果'
          break
        case this.$vo.RectStatus.PRE_ACCE:
          text = '专业部门验收整改结果'
          break
        case this.$vo.RectStatus.ACCE:
          text = '安监部门验收整改结果'
          break
      }
      return text
    },
    dictRctifyStatus (value) {
      let text = '问题未处理'
      switch (value) {
        case this.$vo.RectStatus.INIT:
          text = '问题未处理'
          break
        case this.$vo.RectStatus.TASK:
          text = '已指定责任部门'
          break
        case this.$vo.RectStatus.PLAN:
          text = '整改措施已制定'
          break
        case this.$vo.RectStatus.PRE_APPR:
          text = '专业部门已审核'
          break
        case this.$vo.RectStatus.APPR:
          text = '安监部门已审核'
          break
        case this.$vo.RectStatus.EXEC:
          text = '整改措施已落实'
          break
        case this.$vo.RectStatus.PRE_ACCE:
          text = '专业部门已验收'
          break
        case this.$vo.RectStatus.ACCE:
          text = '安监部门已验收'
          break
      }
      return text
    },
    dictRectifyOperate (value) {
      let op = ''
      switch (value) {
        case this.$vo.RectStep.FIND:
        case this.$vo.RectStep.APPR:
        case this.$vo.RectStep.ACCE:
          op = 'review'
          break
        case this.$vo.RectStep.PLAN:
        case this.$vo.RectStep.EXEC:
          op = 'duty'
          break
      }
      return op
    }
  }
}

export default DictMixin
